GTEST_DIR = ../../../gtest-1.5.0
GTEST_OBJ = gtest_main.a

CC = g++
CFLAGS = -I$(GTEST_DIR)/include
SOURCE = cipher.cpp deck.cpp
TESTS = unit_tests.cpp test_cipher.cpp test_deck.cpp
LFLAGS = -lpthread
OBJECTS = $(SOURCE:.cpp=.o) $(TESTS:.cpp=.o) $(GTEST_DIR)/make/$(GTEST_OBJ)
EXE = tests/run_unit_tests

define \n


endef

all: test

test:
	g++ -c $(CFLAGS) $(SOURCE)
	$(foreach var, $(TESTS), g++ -c $(CFLAGS) tests/$(var) ${\n})
	g++ -o $(EXE) $(LFLAGS) $(OBJECTS)  

clean:
	rm -rf *.o $(EXE)
